<template>
  <view class="body">
    <view
      class="loading_bg"
      :style="{
        backgroundImage: `url(${oss2('others/ultraman/bg_loading.png')})`,
      }"
      ><view
        class="loading_title"
        :style="{
          backgroundImage: `url(${oss2('others/ultraman/loading_title.png')})`,
        }"
      ></view>
      <view
        class="loading_logo"
        :style="{
          backgroundImage: `url(${oss2('others/ultraman/ultraman.gif')})`,
        }"
      ></view>
      <view
        class="loading_pro"
        :style="{
          backgroundImage: `url(${oss2('others/ultraman/loading.gif')})`,
        }"
      ></view>
      <view
        class="loading_wait"
        :style="{
          backgroundImage: `url(${oss2('others/ultraman/loading_wait.png')})`,
        }"
      ></view>

      <view
        class="ultraman_sign"
        :style="{
          backgroundImage: `url(${oss2('others/ultraman/ultraman_gs.png')})`,
        }"
      >
      </view>
    </view>
  </view>
</template>
  
  <script setup>
import { oss2 } from "@/utils/utils";
import { onShow } from "@dcloudio/uni-app";
import { message } from "@/utils/utils";

onShow(async () => {
  getApp().accessLogAdd();

  switch (true) {
    case uni.getLaunchOptionsSync().path ===
      "campaign/pages/ultraman/cardWebview":
      setTimeout(() => {
        getApp()
          .getUserInfo()
          .then((user) => {
            uni.redirectTo({
              url: `/campaign/pages/ultraman/cardWebview?token=${uni.getStorageSync(
                "TOKEN"
              )}&openid=${uni.getStorageSync(
                "OPENID"
              )}&unionid=${uni.getStorageSync("UNIONID")}&memberid=${
                user.memberScore.memberId
              }`,
            });
          });
      }, 1500);
      break;
    case uni.getLaunchOptionsSync().path ===
      "campaign/pages/ultraman/prizeWebview":
      setTimeout(() => {
        getApp()
          .getUserInfo()
          .then((user) => {
            uni.redirectTo({
              url: `/campaign/pages/ultraman/prizeWebview?token=${uni.getStorageSync(
                "TOKEN"
              )}&openid=${uni.getStorageSync(
                "OPENID"
              )}&unionid=${uni.getStorageSync("UNIONID")}&memberid=${
                user.memberScore.memberId
              }`,
            });
          });
      }, 1500);
      break;

    default:
      if (uni.getLaunchOptionsSync().query.from) {
        setTimeout(() => {
          uni.redirectTo({
            url:
              "/" +
              uni.getLaunchOptionsSync().path +
              "?from=" +
              uni.getLaunchOptionsSync().query.from,
          });
        }, 1500);
      } else {
        setTimeout(() => {
          uni.redirectTo({
            url: "/" + uni.getLaunchOptionsSync().path,
          });
        }, 1500);
      }

      break;
  }
});
</script>
  
  <style>
page {
  background-color: #040d30 !important;
}
</style>
  <style lang="less" scoped>
.body {
  width: 100%;
  min-height: 100vh;

  .loading_bg {
    width: 100%;
    height: 100vh;
    background-repeat: no-repeat;
    background-position: top left;
    background-size: 375px 812px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    .loading_title {
      width: 100%;
      height: 52px;
      background-repeat: no-repeat;
      background-position: center;
      background-size: 191px 100%;
      margin-bottom: 42px;
    }
    .loading_logo {
      width: 100%;
      height: 235px;
      background-repeat: no-repeat;
      background-position: center;
      background-size: 375px 100%;
      margin-bottom: 18vh;
    }
    .loading_pro {
      width: 100%;
      height: 40px;
      background-repeat: no-repeat;
      background-position: top left;
      background-size: 375px 100%;
    }
    .loading_wait {
      width: 100%;
      height: 63px;
      background-repeat: no-repeat;
      background-position: center;
      background-size: 144px 100%;
      margin-top: -13px;
    }
    .ultraman_sign {
      width: 75px;
      height: 8px;
      position: absolute;
      left: 150px;
      bottom: 18px;
      background-repeat: no-repeat;
      background-position: top left;
      background-size: 100% 100%;
    }
  }
}
@keyframes ellipsis {
  from {
    width: 13px;
  }
  to {
    width: 39px;
  }
}
</style>
  